import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/user_white_entity.dart';

UserWhiteEntity $UserWhiteEntityFromJson(Map<String, dynamic> json) {
  final UserWhiteEntity userWhiteEntity = UserWhiteEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userWhiteEntity.total = total;
  }
  final List<UserWhiteRows>? rows = (json['rows'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<UserWhiteRows>(e) as UserWhiteRows)
      .toList();
  if (rows != null) {
    userWhiteEntity.rows = rows;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    userWhiteEntity.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    userWhiteEntity.msg = msg;
  }
  return userWhiteEntity;
}

Map<String, dynamic> $UserWhiteEntityToJson(UserWhiteEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['rows'] = entity.rows?.map((v) => v.toJson()).toList();
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  return data;
}

extension UserWhiteEntityExtension on UserWhiteEntity {
  UserWhiteEntity copyWith({
    int? total,
    List<UserWhiteRows>? rows,
    int? code,
    String? msg,
  }) {
    return UserWhiteEntity()
      ..total = total ?? this.total
      ..rows = rows ?? this.rows
      ..code = code ?? this.code
      ..msg = msg ?? this.msg;
  }
}

UserWhiteRows $UserWhiteRowsFromJson(Map<String, dynamic> json) {
  final UserWhiteRows userWhiteRows = UserWhiteRows();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    userWhiteRows.createTime = createTime;
  }
  final UserWhiteRowsParams? params = jsonConvert.convert<UserWhiteRowsParams>(
      json['params']);
  if (params != null) {
    userWhiteRows.params = params;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    userWhiteRows.id = id;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    userWhiteRows.userId = userId;
  }
  final String? whiteName = jsonConvert.convert<String>(json['whiteName']);
  if (whiteName != null) {
    userWhiteRows.whiteName = whiteName;
  }
  final String? whitePhone = jsonConvert.convert<String>(json['whitePhone']);
  if (whitePhone != null) {
    userWhiteRows.whitePhone = whitePhone;
  }
  return userWhiteRows;
}

Map<String, dynamic> $UserWhiteRowsToJson(UserWhiteRows entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['userId'] = entity.userId;
  data['whiteName'] = entity.whiteName;
  data['whitePhone'] = entity.whitePhone;
  return data;
}

extension UserWhiteRowsExtension on UserWhiteRows {
  UserWhiteRows copyWith({
    String? createTime,
    UserWhiteRowsParams? params,
    int? id,
    int? userId,
    String? whiteName,
    String? whitePhone,
  }) {
    return UserWhiteRows()
      ..createTime = createTime ?? this.createTime
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..userId = userId ?? this.userId
      ..whiteName = whiteName ?? this.whiteName
      ..whitePhone = whitePhone ?? this.whitePhone;
  }
}

UserWhiteRowsParams $UserWhiteRowsParamsFromJson(Map<String, dynamic> json) {
  final UserWhiteRowsParams userWhiteRowsParams = UserWhiteRowsParams();
  return userWhiteRowsParams;
}

Map<String, dynamic> $UserWhiteRowsParamsToJson(UserWhiteRowsParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension UserWhiteRowsParamsExtension on UserWhiteRowsParams {
}